#include <iostream>
#include <string>
using namespace std;
int main()
{
    // 输入源字符串
    cout << "Please enter a string:" << endl;
    string str_origin;
    cin >> str_origin;

    // 输入需要查找的字符串
    cout << "Please enter another string:" << endl;
    string str_input;
    cin >> str_input;

    // 计算源字符串和需要查找的字符串的长度
    int str_origin_number = str_origin.length();
    int str_input_number = str_input.length();

    // 计数变量
    int count = 0;

    
    for (int i = 0; i <=str_origin_number - str_input_number; i++)
    {
        string temp = str_origin.substr(i, i + str_input_number);
        if (temp == str_input)
        {
            count++;
        }
    }
    cout << count << endl;
    system("pause");
}
